auto.waitFor();
importPackage(android.speech.tts);
importClass(java.util.Locale);

if (device.isScreenOn()) {
    alert("熬夜死的快", "赶紧睡觉，别熬夜，熬夜死的快，又秃头");


    var tts = new TextToSpeech(context, function (status) {
        if (status != tts.SUCCESS) {
            toast("初始化TTS识别: " + status);
            exit();
        }
        var r = tts.setLanguage(Locale.CHINA);
        if (r < 0) {
            toast("不支持该语言: " + r);
            exit();
        }
        toast("TTS初始化成功");
    });
    tts.setOnUtteranceProgressListener(new UtteranceProgressListener({
        onDone: function (id) {
            //stopQQVoiceRecord();
            //voiceConverting = false;
        }
    }));
    说("赶紧睡觉，别熬夜，熬夜死的快，熬夜又秃头");
}

function 说(text){
    tts.speak(text, tts.QUEUE_ADD, null);
}